#pragma once

#define RGBA(r, g, b, a) ((b&255) + ((g&255) << 8) + ((r&255) << 16) + ((a&255) << 24))
//inline DWORD RGBA(int a, int r, int g, int b)
//{
//	return ((b) + ((g) << 8) + ((r) << 16) + ((a) << 24));
//}

#define COLOR unsigned long

class IPixelDrawer{
public:
	virtual void drawPixel(int x,int y,COLOR color) = 0;
	virtual int getW() = 0;
	virtual int getH() = 0;
	virtual bool testZBuffer(int x,int y,float z) = 0;
	typedef enum{CullNone,CW,CCW}eFrontFace;
	virtual void setCullFrontFace(eFrontFace face) = 0;
	virtual eFrontFace getCullFrontFace() = 0;
};

class IPrimitive
{
public:
	virtual void draw(IPixelDrawer* dr) = 0;
	virtual void setShowBorder(bool b){_bShowBorder = b;};
protected:
	bool _bShowBorder;
};

